/*
 * @Description:
 * @Author: xunzhaotech
 * @Email: luyb@xunzhaotech.com
 * @QQ: 1525572900
 * @Date: 2025-04-10 09:49:49
 * @LastEditTime: 2025-05-30 15:28:12
 * @LastEditors: xunzhaotech
 */
import request from '@/config/axios'

// ERP 能耗 VO
export interface EnergyVO {
  id: number // 能耗编号
  name: string // 能耗名字
  workshopId: number // 车间编号
  unitId: number // 单位编号
  hardwareIdentifier: string // 硬件标识
  sort: number // 排序
}

// ERP 能耗 API
export const EnergyApi = {
  // 查询ERP 能耗分页
  getEnergyPage: async (params: any) => {
    return await request.get({ url: `/erp/energy/page`, params })
  },

  // 查询ERP 能耗详情
  getEnergy: async (id: number) => {
    return await request.get({ url: `/erp/energy/get?id=` + id })
  },

  // 新增ERP 能耗
  createEnergy: async (data: EnergyVO) => {
    return await request.post({ url: `/erp/energy/create`, data })
  },

  // 修改ERP 能耗
  updateEnergy: async (data: EnergyVO) => {
    return await request.put({ url: `/erp/energy/update`, data })
  },

  // 删除ERP 能耗
  deleteEnergy: async (id: number) => {
    return await request.delete({ url: `/erp/energy/delete?id=` + id })
  },

  // 导出ERP 能耗 Excel
  exportEnergy: async (params) => {
    return await request.download({ url: `/erp/energy/export-excel`, params })
  }
}
